//
//  IndexVC.swift
//  BaseProject
//
//  Created by guolinsong on 2018/7/2.
//  Copyright © 2018年 guolin song. All rights reserved.
//

import UIKit

class IndexVC: BaseViewController, UITableViewDataSource, UITableViewDelegate {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        navigationItem.title = "首页"
        
        BaseRequestTool.loadHomeListData(success: { (dict) in
            dict.forEach({ (model) in
                print("something--"+"\(model.abstract!)")
            })
            
        }) { (error) in
            
        }
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }

    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 13
    }
    
    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
        return 70
    }
    
    func tableView(_ tableView: UITableView, titleForHeaderInSection section:
        Int) -> String?{
        return "Head"
    }
    
    func tableView(_ tableView: UITableView, titleForFooterInSection section:
        Int) -> String?{
        return "Foot"
    }
    
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell:UITableViewCell = UITableViewCell(style: UITableViewCellStyle.subtitle, reuseIdentifier: nil)
        cell.textLabel!.text = "Cell text"
        cell.detailTextLabel?.text = "Cell Subtitle"
        cell.imageView!.image = UIImage(named:"tabBar_new_click_icon")
        return cell
    }
    
    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        tableView.deselectRow(at: indexPath, animated: true)
        print("indexPath：\(indexPath.row)")
    }
    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
